{layout name="public/layout" /}
{include file='yxnavbar'}


{include file='theme_menu'}
<form class="form-horizontal form" action="" id="form1"  method="post" enctype="multipart/form-data">
    <div class="form-group"><!--
        	分别是白色，浅蓝色，深蓝色，绿色，黄色，红色，黑色，
			对应的class为btn,btn btn-primary,btn btn-info,btn btn-success,btn btn-warning,btn btn-danger,btn btn-inverse -->
        {if $system['wxapp']==0 || $system['softmode']!=1 }
        {if empty($theme['desc']) && ($system['wxapp']==0 || $system['softmode']!=1)}
        <label class="btn col-lg-1"></label> <label class="btn btn-warning col-xs-12 col-sm-4 col-md-3 col-lg-2">副标题未设置</label>
        {/if}
        {/if}

        {if ($theme['status'])!=1}
        <label class="btn col-lg-1"></label> <label class="btn btn-warning col-xs-12 col-sm-4 col-md-3 col-lg-2">活动已停止</label>
        {/if}
        {if ($theme['endtime'] < TIMESTAMP)}
        <label class="btn col-lg-1"></label> <label class="btn btn-warning col-xs-12 col-sm-4 col-md-3 col-lg-2">活动时间已结束</label>
        {/if}
        {if empty($config['headlogo'])}
        <label class="btn col-lg-1"></label> <label class="btn btn-danger col-xs-12 col-sm-4 col-md-3 col-lg-2">活动主图未上传</label>
        {/if}
        {if empty($config['content'])}
        <label class="btn col-lg-1"></label> <label class="btn btn-danger col-xs-12 col-sm-4 col-md-3 col-lg-2">活动内容未上传</label>
        {/if}
        {if empty($theme['mobile'])}
        <label class="btn col-lg-1"></label> <label class="btn btn-danger col-xs-12 col-sm-4 col-md-3 col-lg-2">客服电话未设置</label>
        {/if}
        {if $system['fenxiao']==1 && empty($system['autored'])}
        <label class="btn col-lg-1"></label> <label class="btn btn-info col-xs-12 col-sm-4 col-md-3 col-lg-2">自动发红包未设置</label>
        {/if}


    </div>
    {if !empty($system['appid']) }
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">活动网址{if $_G['isSuperAdmin']}<a href="#"
                                                               onclick="drop_confirm('确定要重置吗?','{php echo createWebUrl('theme',array('op'=>'qrnew','id'=>$themeid));}');"
                                                               title="重新生成链接二维码"> 【重新生成链接二维码】</a>{/if}</div>
        <div class="panel-body" style="">
            {if $system['wxapp']==0 || $system['softmode']!=1 }
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">H5主链接</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea type="textarea" class="form-control"  readonly="readonly" >{php echo \app\model\Theme::getModuleName();}活动网址：{php echo $config['indexurl'];}{if $theme['isautorefund']==0}&#13;可以用在公众平台文章阅读原文，群发软件群发等{else}&#13;特别提醒:已开通24小时不满团自动退款{/if}</textarea>
                </div>
            </div>
            {/if}
            {if $system['wxapp']!=0 && $system['softmode']!=0 }
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">小程序路径</label>
                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control"  readonly="readonly"  value="{$xcxurl}">
                </div>
            </div>
            {if DOMAIN1=="www.yixuan.net"}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">小程序调试</label>
                <div class="col-sm-6 col-xs-12">
                    <textarea  rows="1" type="textarea" class="form-control"  readonly="readonly" >{php echo 'uniacid: "'.$system['wxapp'].'",scene: "' . MODULE_NAME . '-'. $themeid.'-0-'.$theme['softkey'].'-0",'.$system['appidxcx'];}</textarea>

                </div>
                {if $third_wxapp_item}
                <div class="col-sm-4 col-xs-12">
                    {if $third_wxapp_item['status']==-1}
                    <button class="btn btn-info js-clip" type="button" onclick="showThirdWxappInfo()">立即提审</button>
                    {elseif $third_wxapp_item['status']==1}
                    <button class="btn btn-danger js-clip" type="button" onclick="showThirdWxappInfo()">审核失败，重新提审</button>
                    {elseif $third_wxapp_item['status']==2}
                    <button class="btn btn-warning js-clip" type="button" onclick="showThirdWxappInfo()">审核中</button>
                    {elseif $third_wxapp_item['status']==5}
                    <button class="btn btn-success js-clip" type="button" onclick="showThirdWxappInfo()">已发布-版本：{php echo $third_wxapp_item['online_version'];}</button>
                    {elseif $third_wxapp_item['status']==0}
                    <button class="btn btn-success js-clip" type="button" >审核成功,系统自动发布中</button>
                    {elseif $third_wxapp_item['status']==3}
                    <button class="btn btn-danger js-clip" type="button" onclick="showThirdWxappInfo()">已撤回</button>
                    {else}
                    {/if}

                    {if $third_wxapp_item['status']==0}
                    <span class="help-block" style="color: red;">请在1分钟后，刷新当前页面查看代码发布状态</span>
                    {/if}

                    <button class="btn btn-danger js-clip" type="button" onclick="changeInterfaceMode('hand')">切换手动对接</button>
                </div>
                {/if}

            </div>
            {elseif $_G['isSuperAdmin']}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">小程序调试</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea  rows="1" type="textarea" class="form-control"  readonly="readonly" >{php echo 'dev_scene:"' . MODULE_NAME . '-'. $themeid.'-0-'.$theme['softkey'].'-0",';}</textarea>
                </div>
            </div>
            {/if}
            {/if}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">二维码</label>
                <div class="col-sm-8 col-xs-12">
                    {if $system['wxapp']==0 || $system['softmode']!=1 }
                    <div class="col-sm-6" style="text-align: center;">
                        <img style="width: 299px;" src="{php echo createWebUrl('qr',array('url'=>$config['indexurl']));}"><br><br>活动二维码{php echo \app\model\Theme::getModuleName();}
                    </div>
                    {/if}
                    {if $system['wxapp']!=0 && $system['softmode']!=0 }
                    {if !empty($config['indexurlxcx'])}
                    <div class="col-sm-6" style="text-align: center;">
                        <img style="width: 299px;" src="{$config['indexurlxcx']}"><br><br>活动二维码{php echo \app\model\Theme::getModuleName();}
                    </div>
                    {/if}
                    {/if}
                </div>
            </div>
            {if $system['ispresale']==1}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">补款预览二维码</label>
                <div class="col-sm-8 col-xs-12">
                    {if $system['wxapp']==0 || $system['softmode']!=1 }
                    {php $indexurl_pr = $_G['url_scheme'] . DOMAIN0 . '/' . createMobileUrl('index', array('themeid' => $themeid,'recordid'=>99999));}
                    <div class="col-sm-6" style="text-align: center;">
                        <img style="width: 299px;" src="{php echo createWebUrl('qr',array('url'=>$indexurl_pr));}"><br><br>补款预览二维码{php echo \app\model\Theme::getModuleName();}
                    </div>
                    {/if}
                    {if $system['wxapp']!=0 && $system['softmode']!=0 }
                    {php $scene = MODULE_NAME . "-" . $theme['id'] . "-0-" . $theme['softkey']. "-99999";}
                    {php $indexurlxcx_pr = \app\model\Poster::CreateScene($system, $scene, $config, 'pages/index/index');}
                    <div class="col-sm-6" style="text-align: center;">
                        <img style="width: 299px;" src="{$indexurlxcx_pr}"><br><br>补款预览二维码{php echo \app\model\Theme::getModuleName();}
                    </div>
                    {/if}
                </div>
            </div>
            {/if}
        </div>
    </div>
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">{php echo $system['is_multiple_merchants']?'注册管理员二维码':'注册二维码';}</div>
        <div class="panel-body" style="">
            {if empty($theme['softsn'])}
            <span class="help-block">软件未激活</span>
            {else}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"></label>
                <div class="col-sm-8 col-xs-12">
                    {if !empty($config['addworkerurl']) && $system['softmode']!=1}
                    <div class="col-sm-6" style="text-align: center;"><img style="width: 299px;" src="{$config['addworkerurl']}"><br><br>{php echo $system['is_multiple_merchants']?'注册管理员二维码':'注册二维码';}{php echo \app\model\Theme::getModuleName();}</div>
                    {/if}

                    {if !empty($config['addworkerurlxcx']) && $system['softmode']!=0 && $system['wxapp']!=0}
                    <div class="col-sm-6" style="text-align: center;"><img style="width: 299px;" src="{$config['addworkerurlxcx']}"><br><br>{php echo $system['is_multiple_merchants']?'小程序注册管理员':'小程序注册';}{php echo \app\model\Theme::getModuleName();}</div>
                    {/if}
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"></label>
                <div class="col-sm-8 col-xs-12">
                        <span class="help-block">{if !$system['is_multiple_merchants']}您检查一下看有没有问题，如果没有问题，管理员(老师/老板/店长)先扫描这个二维码，{if $config['workerpass_mode']=='0'}点左上角的后退按扭，{/if}输入管理密码【{$system['adminpass']}】，设置好分队信息(可略过)，注册好后把这个二维码发到内部群，让所有员工扫描二维码，{if $config['workerpass_mode']!='0'}输入添加员工密码({$config['workerpass']})，再{/if}输入姓名和电话，然后转发链接，这样就可以看到客户是哪个员工的业绩了.<br><br>
                        管理密码是:{$system['adminpass']} (拥有所有权限，可查看所有客资) <br>
                        员工密码是:{$config['workerpass']}(只可查看自己的客资{if $config['workerpass_mode']=='0'}，已开启员工免密码注册{/if})
                        {else}您检查一下看有没有问题，如果没有问题，然后把下方员工注册二维码发到对应的微信群，让所有商家的员工扫码，再输入姓名和电话，注册好后转发链接，这样就可以看到客户是哪个商家-哪个员工的业绩了.<br><br>
                        超级管理密码是:{$system['adminpass']} (拥有所有权限，可查看所有商家客资) <br>
                        {/if}
                    </span>
                </div>
            </div>
            {/if}
        </div>
    </div>
    {if $system['is_multiple_merchants']}
    <style type="text/css">
        .exclusive-image  li{
            list-style: none;
            display: inline-block;
            height: 360px;/*当图片尺寸不一的时候，设置一个高度*/
            width: 260px;/*三列图片排列*/
            /*三列图片排列*/
            text-align: center;
            /*内容居中*/
            overflow: hidden;
            /*超出隐藏*/
            vertical-align: bottom;
            /*内容底部对齐*/
            margin: 20px;
        }
        .img-content {
            width: 96%;
            padding: 5px 0;
            overflow: hidden;
        }

        .img-wrap {
            padding: 10px;
            background-color: #fff;
            border: 1px solid #ccc;
        }

        .img-box {
            height: 260px;
            overflow: hidden;
        }
        .img-box img {
            position: relative;
            width: 260px;
            height: 260px;
            top: 50%;
            transform: translateY(-50%);
        }
        .title{
            font-size: 12px;
            color: #454545;
            height: 18px;
            overflow: hidden;
        }
        .title2{
            font-size: 12px;
            color: #cb2c01;
            font-weight: 800;
        }
        .red_font{
            color: red;
        }
        .title3{
            font-size: 12px;
            color: #3f8cfe;
        }
        .title4{
            font-size: 12px;
            color: #f25b9b;
        }

    </style>

    <div class="panel panel-default" role="tabpanel">
        <div class="panel-heading">商家员工注册二维码   商家数量【<span style="color: #ff0000">{php echo count($shoplist);}</span>个】
            {if $_G['isSuperAdmin']}
            <a class="btn btn-default" href="{php echo createWebUrl('shangjia',array('themeid'=>$themeid,'op'=>'renew_qr_all'));}" data-val="default">更新所有二维码</a>
            {/if}
        </div>
        <div class="panel-body">
            <div class="form-group">
                <div class="col-xs-12 exclusive-image" >
                    <ul id="exclusive_image">
                        {loop $shoplist $i $row}
                        <li>
                            <div class="img-content">
                                <div class="img-box">
                                    <img id = 'imgqr{$row['id']}' src="{$row['worker_init_qr']}"></div>
                            </div>
                            <div class="title">{$row['name']}</div>
                            <div class="title"></div>
                            <div class="title">管理员密码：<span class="title">{$row['shoppass']}</span></div>
                            <div class="title" style="height: 38px;">
                                <a class="btn btn-info btn-sm " href="javascript:void(0);" onclick="renew_qr({$row['id']})" title="更新二维码"><i class="icon-edit"></i>更新二维码</a>
                            </div>
                        </li>
                        {/loop}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script >
        function renew_qr(id){

            var postUrl = "{php echo createWebUrl('shangjia', array('op' => 'renew_qr','themeid'=>$themeid));}";
            $.ajax({
                url:postUrl,
                dataType:'json',
                method:'post',
                data: {id:id},
                success:function (e) {
                    let res = e.result;
                    let status = e.status;
                    let msg = res.msg;
                    if (status!=1){
                        layer.msg(msg);
                    }else{
                        $('#imgqr'+id).attr('src',res.qrurl);
                        layer.msg(msg);
                    }
                },
                fail:function (err) {
                    console.log(err)
                }
            });
        }
    </script>
    {/if}
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">数据大屏网址</div>
        <div class="panel-body" style="">
            {if empty($theme['softsn'])}
            <span class="help-block">软件未激活</span>
            {else}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">极简大屏网址</label>
                <div class="col-sm-6 col-xs-12">
                    <input type="text" class="form-control"  readonly="readonly"  value="{$config['dapingurl']}">
                </div>
                <div class="col-sm-4 col-xs-12">
                    <a href="javascript:;" class="btn btn-default js-clip" data-url="{$config['dapingurl']}"  >复制网址</a>
                    <a href="{$config['dapingurl']}" class="btn btn-info" target="_blank">打开投屏</a>
                </div>
            </div>
            {if !LINGZE_SERVER}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">新版数据大屏</label>
                {php $daping_new = $_G['url_scheme'] . DOMAIN0 . '/' . createMobileUrl('daping', array('themeid' => $themeid,'dpkey'=>\app\model\Theme::getDapingKey($theme)));}
                <div class="col-sm-6 col-xs-12">
                    <input type="text" class="form-control"  readonly="readonly"  value="{$daping_new}">
                </div>
                <div class="col-sm-4 col-xs-12">
                    <a href="javascript:;" class="btn btn-default js-clip" data-url="{$daping_new}"  >复制网址</a>
                    <a href="{$daping_new}" class="btn btn-info" target="_blank">打开新版投屏</a>
                </div>
            </div>
            {/if}
            {if LINGZE_SERVER}
            {php $daping_lingze = $_G['url_scheme'] . DOMAIN0 . '/' . createMobileUrl('w_daping_lingze', array('themeid' => $themeid,'dpkey'=>\app\model\Theme::getDapingKey($theme)));}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">领泽专用投屏</label>
                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control"  readonly="readonly"  value="{$daping_lingze}">
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">二维码</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="col-sm-6" style="text-align: center;"><img style="width: 299px;" src="{php echo createWebUrl('qr',array('url'=>$config['dapingurl']));}"><br><br>投屏二维码</div>
                    {if LINGZE_SERVER}
                    <div class="col-sm-6" style="text-align: center;"><img style="width: 299px;" src="{php echo createWebUrl('qr',array('url'=>$daping_lingze));}"><br><br>领泽专用投屏</div>
                    {else}
                    <div class="col-sm-6" style="text-align: center;"><img style="width: 299px;" src="{php echo createWebUrl('qr',array('url'=>$daping_new));}"><br><br><span style="color:#54c9e8;">新版投屏</span></div>
                    {/if}
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"></label>
                <div class="col-sm-8 col-xs-12">
                        <span class="help-block">将实时数据投屏,可用于活动现场爆破;有语音播报也可以连到店内音响系统进行播报</span>
                </div>
            </div>
            {/if}
        </div>
    </div>
    {/if}
    {if empty($system['appid'])}
    <div class="form-group">
        <div class="col-sm-12">
            <label class="btn btn-warning col-xs-12 col-sm-4 col-md-3 col-lg-2">参数设置未提交</label>
        </div>
    </div>
    {/if}

<!--    <div class="form-group" style="width:120px;position:fixed; right:30px; bottom:45%;z-index: 1000">-->
<!--        <div class="col-sm-12">-->
<!--            <input  name="submit" id="Confirm" type="submit" value="提交" class="btn btn-primary col-lg-12">-->
<!--            <input type="hidden" name="__token__" value="{$Request.token}" />-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group" >-->
<!--        <div class="col-sm-12">-->
<!--            <input  name="submit" id="btnConfirm" type="submit" value="提交" class="btn btn-primary col-lg-3" style="width:120px;">-->
<!--            <input type="hidden" name="__token__" value="{$Request.token}" />-->
<!--            <input type="hidden" id="goto" name="goto" value="" />-->
<!--            <span class="help-block col-lg-3"> 可按 ctrl+s 快速保存</span>-->
<!--        </div>-->
<!--    </div>-->
</form>


<!--弹出层-->
<div style="z-index: 6;margin: 0 auto;display: none;" id="third_wxapp_info">
    <div class="panel panel-default" role="tabpanel" style="">
<!--        <div class="panel-heading">小程序审核信息</div>-->
        <div class="panel-body" style="display: flex;flex-direction: column;">
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label" style="line-height: 34px;height: 34px;">线上版本</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea type="textarea" rows="1" class="form-control"  readonly="readonly" >{php echo $third_wxapp_item['online_version'];}</textarea>
                </div>
            </div>
            <input type="hidden" name="curt_template_id" id="curt_template_id" value="{php echo $third_wxapp_item['online_version'];}">
            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label" style="line-height: 34px;height: 34px;">选择上传版本</label>
                <div class="col-sm-8 col-xs-12">
                    <select class="form-control" id="third_template_id" name="third_template_id">
                        <option data-tmpid="{$third_template_list['default']['template_id']}" value="{$third_template_list['default']['template_id']};{php echo $third_template_list['default']['user_version'];};{php echo $third_template_list['default']['user_desc'];}" >{$third_template_list['default']['user_version']}--{php echo substr($third_template_list['default']['user_desc'],0,strpos($third_template_list['default']['user_desc'], PHP_EOL));}</option>
                        {loop $third_template_list['list']  $val1}
                        <option data-tmpid="{$val1['template_id']}" value="{$val1['template_id']};{php echo $val1['user_version'];};{php echo $val1['user_desc'];}" >{php echo $val1['user_version'];}--{php echo substr($val1['user_desc'],0,strpos($val1['user_desc'], PHP_EOL));}</option>
                        {/loop}
                    </select>
                    {if $third_wxapp_item['status']==5}
                    <span class="help-block" style="color: red;">如需提交新版本，请重新选择上传版本，并且上传版本与线上版本不一致</span>
                    {/if}
                </div>
            </div>
            {if $third_wxapp_item['status']==1}
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label" style="line-height: 34px;height: 34px;">失败原因</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea  rows="10" type="textarea" class="form-control"  readonly="readonly" >{php echo json_decode($third_wxapp_item['status_desc'],true)['desc'];}</textarea>
                </div>
            </div>
            {/if}

            <div class="form-group" id="sub_upload" >
                <div class="col-sm-12" style="margin-top: 20px;">
                    {if $third_wxapp_item['status']==-1}
                    <input name="submit" onclick="submitAudit()" id="btn1"  type="button" value="确认提交" class="btn btn-primary col-lg-2">
                    {/if}
                    {if $third_wxapp_item['status']==1}
                    <input name="submit" onclick="submitAudit()" id="btn1"  type="button" value="确认修改并重新提交" class="btn btn-primary col-lg-2">
                    {/if}
                    {if $third_wxapp_item['status']==2}
                    <input name="submit"  id="btn2"  type="button" value="审核中" class="btn btn-warning col-lg-2">
                    {/if}
                    {if $third_wxapp_item['status']==5}
                    <input name="submit"  id="btn3"  type="button" value="已发布" disabled class="btn btn-default col-lg-2">
                    <input name="submit" id="btn4" onclick="revertCodeRelease()"  type="button" value="版本回退" class="btn btn-danger col-lg-2">
                    {/if}
                    <input name="submit" onclick="submitAudit()" id="btn12" style="display: none;"  type="button" value="提交当前版本" class="btn btn-primary col-lg-2">
                </div>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript">
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }

    function submitForm(){
        var form = document.getElementById("myform");
        form.submit();
    }

    function showThirdWxappInfo() {
        layer.open({
            type:1,
            title:'小程序审核信息',
            area: '800px',
            content: $("#third_wxapp_info"),
            success:function (layero,index) {
                // var iframe = layui.$(layero).find('iframe');
                // //设定iframe的高度为当前iframe内body的高度
                // iframe.css('height', iframe[0].contentDocument.body.offsetHeight);
                // //重新调整弹出层的位置，保证弹出层在当前屏幕的中间位置
                // $(layero).css('top', (window.innerHeight - iframe[0].offsetHeight) / 2);
            }
        });
    }
    //提交代码审核
    function submitAudit() {
        $("#btn1").attr("disabled","true");
        var loadIndex = layer.msg('正在提交请等待...', {icon: 16,time:20*1000});
        let third_template_id = $("#third_template_id").val();
        var post_url = "{php echo createWebUrl('qrcode',array('op'=>'submitAudit','themeid'=>$themeid));}";
        $.ajax({
            url:post_url,
            dataType:'json',
            method:'post',
            data:{third_template_id:third_template_id},
            success:function (e) {
                layer.close(loadIndex);
                let status = e.status;
                let result = e.result;
                $("#btn1").removeAttr("disabled");
                if (status!=1){
                    layer.msg(result.msg)
                }else{
                    layer.msg(result.msg)
                    setTimeout(function () {
                        window.location.reload();
                    },1500);
                }
            },
            fail:function (err) {
                console.log(err)
            }
        });
    }
    //版本回退
    function revertCodeRelease() {
        layer.confirm('确认进行版本回退吗？',{
            btn:['确认','取消'],
            yes:function () {
                var post_url = "{php echo createWebUrl('qrcode',array('op'=>'revertCodeRelease','themeid'=>$themeid));}";
                $.ajax({
                    url:post_url,
                    dataType:'json',
                    method:'post',
                    data:{aaa:123},
                    success:function (e) {
                        let status = e.status;
                        let result = e.result;
                        if (status!=1){
                            layer.msg(result.msg)
                        }else{
                            layer.msg(result.msg)
                            setTimeout(function () {
                                window.location.reload();
                            },1500);
                        }
                    },
                    fail:function (err) {
                        console.log(err)
                    }
                });
            },
            btn2:function () {

            }
        })
    }
    //切换上传版本
    $("#third_template_id").on("change",function () {
        let curt_tempid = $(this).find("option:selected").attr('data-tmpid');
        let online_template_id = "{php echo $third_wxapp_item['template_id'];}";
        if (online_template_id){
            if (curt_tempid!=online_template_id){
                $("#btn12").show();
                $("#btn1").hide();
                $("#btn3").hide();
                $("#btn4").hide();
            }else{
                $("#btn12").hide();
                $("#btn3").show();
                $("#btn4").show();
            }
        }
    });
    //切换对接模式
    function changeInterfaceMode(mode) {
        let msg = '切换到手动对接，需要登录微信公众号版本管理取消授权，并联系技术部手动上传代码，确认进行次操作吗？';
        if (mode!='hand'){
            msg = '此操作需要对接小程序已授权给易宣软件并建立授权关系，如不明确请联系技术部。确认切换到系统对接吗？';
        }
        layer.confirm(msg,{
            btn:['确定']
        },function () {
            var post_url = "{php echo createWebUrl('qrcode',array('op'=>'changeInterfaceMode','themeid'=>$themeid));}";
            $.ajax({
                url:post_url,
                dataType:'json',
                method:'post',
                data:{mode:mode},
                success:function (e) {
                    let status = e.status;
                    let result = e.result;
                    if (status!=200){
                        layer.msg(result.msg)
                    }else{
                        layer.msg(result.msg)
                        setTimeout(function () {
                            window.location.reload();
                        },1500);
                    }
                }
            });
        })
    }
</script>
